package cn.lzm.utils;

import cn.hutool.core.util.StrUtil;
import cn.hutool.setting.dialect.Props;
import cn.lzm.config.RpcConfig;

/**
 * @author lzm
 * @Date 2024/7/27
 * @description
 */
public class ConfigUtils {

    public static RpcConfig getRpcConfig(String env) {
        StringBuilder configFile = new StringBuilder("application");
        if (StrUtil.isNotBlank(env)) {
            configFile.append("-").append(env);
        }
        configFile.append(".properties");
        Props props = new Props(configFile.toString());
        return props.toBean(RpcConfig.class, "rpc");
    }


}
